package com.train.daily.api;

import com.train.common.resp.CommonResp;
import com.train.daily.dto.train.DailyTrainExistsDTO;
import com.train.daily.dto.train.DailyTrainValidationDTO;
import com.train.daily.service.DailyTrainService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class DailyTrainApiImpl implements DailyTrainApi {

    @Autowired
    private DailyTrainService dailyTrainService;

    @Override
    public CommonResp generateDailyTrain(String date) {
        dailyTrainService.generateDailyTrain(date);
        return CommonResp.ok();
    }

    @Override
    public CommonResp existsTrain(DailyTrainExistsDTO dto) {
        dailyTrainService.existsTrain(dto);
        return CommonResp.ok();
    }

    @Override
    public CommonResp validTrainTime(DailyTrainValidationDTO dto) {
        dailyTrainService.validTrainTime(dto);
        return CommonResp.ok();
    }
}
